﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DataAggregationService.Model
{
	public class SyncConfig
	{
		public int TaskInterval { get; set; }
		public int SelectAmount { get; set; }
		public string CompanyName { get; set; }
		public string ProductLine { get; set; }
		public List<DBConfig> SynDatabases { get; set; }
		public List<SynTable> SynTables { get; set; }
	}

	public class DBConfig
	{
		public string Name { get; set; }
		public string Type { get; set; }
		public string ConnectionString { get; set; }
	}

	public class SynTable
	{
		public string SourceDbName { get; set; }
		public string TargetDbName { get; set; }
		public string SourceTable { get; set; }
		public string TargetTable { get; set; }
		public string SynField { get; set; }
		public string SynFieldType { get; set; }
		public string SourceWhere { get; set; }
		public List<SynColumn> SynColumns { get; set; }
	}

	public class SynColumn
	{
		public string SourceColName { get; set; }
		public string TargetColName { get; set; }
		public string Type { get; set; }
		public bool IsInsertable { get; set; } = true;
		public bool IsUpdateable { get; set; } = true;
		public bool IsExistCheck { get; set; } = false;
	}
}
